class Calculator{
  def calculate(a:Int,b:Int,c:Char): Unit ={
    c match {
      case '+' => println("输出%d".format(a+b))
      case '-' => println("输出%d".format(a-b))
      case '*' => println("输出%d".format(a*b))
      case '/' => println("输出%d".format(a/b))
      case _ => println("Invalid operator")
    }
  }
}
object maintest {
  def main(args: Array[String]): Unit = {
    val calculator=new Calculator()
    calculator.calculate(10,5,'+')
    calculator.calculate(10,5,'-')
    calculator.calculate(10,5,'*')
    calculator.calculate(10,5,'/')
    calculator.calculate(10,5,'%')
  }
}